package org.afun.oldhand.user.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.util.Log;

import org.afun.oldhand.R;
import org.afun.oldhand.user.adapter.UserBasicInformationAdapter;
import org.afun.oldhand.user.javabean.BasicInformation;

import java.util.ArrayList;
import java.util.List;

public class BasicMsgActivity extends AppCompatActivity {
    private List<BasicInformation> data = new ArrayList<>();


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_basic_msg);
        initView();
    }

    public void initView() {
        RecyclerView recyclerView = findViewById(R.id.basicinformationRV);
        data.add(new BasicInformation(0,"小凡","你好世界","123456","10086","草棚"));

        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(linearLayoutManager);

        UserBasicInformationAdapter userBasicInformationAdapter = new UserBasicInformationAdapter(data,this);
        recyclerView.setAdapter(userBasicInformationAdapter);

        userBasicInformationAdapter.setBasicInformtionItemClickListener(new UserBasicInformationAdapter.OnBasicinformtionItemClickListener() {
            @Override
            public void onItemRecyclerItemClick(int position) {
                Log.e("testbasicInformation", "onItemRecyclerItemClick: "+position );
            }
        });
    }
}